In This Topic
    In This Topic

    The following example demonstrates how to provide a default cell editor for columns that have an Int32 data type.

    XAML
    Copy Code
    <Grid xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid"
          xmlns:s="clr-namespace:System;assembly=mscorlib">
      <Grid.Resources>
        <xcdg:DataGridCollectionViewSource x:Key="cvs_orders"
                                        Source="{Binding Source={x:Static Application.Current},
                                                          Path=Orders}"/>
      </Grid.Resources>
      <xcdg:DataGridControl x:Name="OrdersGrid"
                            ItemsSource="{Binding Source={StaticResource cvs_orders}}">
       <xcdg:DataGridControl.DefaultCellEditors>
         <xcdg:CellEditor x:Key="{x:Type s:Int32}">
           <xcdg:CellEditor.EditTemplate>
             <DataTemplate>
               <Slider Value="{xcdg:CellEditorBinding}"/>
             </DataTemplate>
           </xcdg:CellEditor.EditTemplate>
         </xcdg:CellEditor>
       </xcdg:DataGridControl.DefaultCellEditors>
      </xcdg:DataGridControl>
    </Grid>